<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<style type="text/css">
        *{margin:0;padding:0;}
        .container{border:1px solid red;width:300px;}
        #box1{background-color:green;float:left;width:100px;height:100px;}
        #box2{background-color:deeppink; float:right;width:100px;height:100px; }
        #box3{background-color:pink;width:100px;height:40px;}
    </style>
</head>
<body>

<div class="container">
    <div id="box1">box1 向左浮动</div>
<!--     <div id="box2">box2 向右浮动</div> -->
</div>
<div id="box3">box3</div>
</body>